package com.studyyoun.android.androidcommonbaselibrary.utils;

import android.content.Context;
import android.text.TextUtils;
import android.widget.Toast;

/**
 * Created by androidlongs on 17/3/14.
 * 站在顶峰，看世界
 * 落在谷底，思人生
 */

public class ToastUtils {
    private static Toast mToast;

    public static void show (String msg, Context context) {
        if (!TextUtils.isEmpty(msg)) {
            if (mToast == null) {
                mToast = Toast.makeText(context, msg, Toast.LENGTH_SHORT);
            } else {
                mToast.setText(msg);
            }

            mToast.show();
        }
    }

    public static void showL (String msg, Context context) {
        if (!TextUtils.isEmpty(msg)) {
            if (mToast == null) {
                mToast = Toast.makeText(context, msg, Toast.LENGTH_SHORT);
            } else {
                mToast.setText(msg);
            }

            mToast.setDuration(Toast.LENGTH_LONG);
            mToast.show();
        }
    }

}
